/**
 *
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 *
 */
package org.baatar.opt.genetic.improve;

import java.io.Serializable;
import org.baatar.opt.genetic.chromosome.IChromosome;
import org.baatar.util.RandomUtil;

/**
 * 
 * 
 * @author B_ZEREN
 */
public interface IImprover<T, M> extends Serializable, Cloneable {

    /**
     * Repairs the chromosome object according to the applied algorithm.
     * 
     * @param chromosome to be repaired.
     * 
     */
    public void repair(IChromosome<T, M> chromosome);

    /**
     * Runs greedy operation according to the applied algorithm to this 
     * IChromosome object.
     * 
     * @param chromosome to be improved.
     * @param greedRatio rate for the greedy operator.
     * @param random Randomization class to be used.
     * 
     */
    public void runGreedyOperator(IChromosome<T, M> chromosome,
                                    float greedRatio,
                                    RandomUtil random);

    /**
     * Runs applied heuristic algorithm on this IChromosome object when 
     * optimization run is finished.
     * 
     * @return boolean true if postProcessing did some improvement on the solution.
     * 
     * @param chromosome to be improved.
     * 
     */
    public boolean postProcess(IChromosome<T, M> chromosome);

    /**
     * Clones the this object.
     * 
     * @return Object new cloned object.
     * 
     * @throws CloneNotSupportedException is trown if this object doesnt
     * implements Cloneable interface.
     */
    public Object clone() throws CloneNotSupportedException;
}